package trinnes.oliver.unimaas.smartpentalath.intelligence.features;

import java.util.ArrayList;
import java.util.List;
import trinnes.oliver.unimaas.smartpentalath.control.Game;
import trinnes.oliver.unimaas.smartpentalath.data.Cell;
import trinnes.oliver.unimaas.smartpentalath.data.Move;

/**
 *
 * @author Oliver Trinnes
 */
public class GroupFeature extends Feature
{

  public GroupFeature(int weight)
  {
    super(weight);
  }

  public int getValue(Game game, int move)
  {
    if (move == Move.SWAP)
      return 0;
    List<Cell> group = new ArrayList<Cell>();
    game.getBoard().populateGroup(game.getBoard().getCells().get(move),group);
    return group.size();
  }
}
